<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div>
    <form action="">
        <button type="reset">重置按钮</button>
        <hr>
        <!-- 第一列 -->
        <label>原始数据输入</label><input type="text" id="in1">
        <br>
        <!-- 按钮 -->
        <button type="button" onclick="rounding()">取整（四舍五入）</button>
        <button type="button" onclick="ceilFunction()">取整（大于）</button>
        <button type="button" onclick="floorFunction()">取整（小于）</button>
        <br>
        <button type="button" onclick="sqrtFunction()">平方根</button>
        <button type="button" onclick="absFunction()">绝对值</button>
        <button type="button" onclick="sinFunction()">正弦值</button>
        <button type="button" onclick="cosFunction()">余弦值</button>
        <br>
        <!--运算结果-->
        <label>运算结果</label><input type="text" id="out1" disabled>

        <hr>
        <!-- 第二列 -->
        <label>原始数据输入</label><input type="text" id="in2"> <input type="text" id="in3"><br>
        <!--按钮-->
        <button type="button" onclick="getMinNum()">求较小值</button>
        <button type="button" onclick="getMaxNum()">求较大值</button>
        <br>
        <!--运算结果-->
        <label>运算结果</label><input type="text" id="out2" disabled>


    </form>

</div>

<script>
    // 获取结点
    // 输入结点
    let in1 = document.getElementById("in1");
    let in2 = document.getElementById("in2");
    let in3 = document.getElementById("in3");

    // 输出结点
    let out1 = document.getElementById("out1");
    let out2 = document.getElementById("out2");

    // 四舍五入算法
    function rounding(){
        let number = Math.round(eval(in1.value));
        console.log("rounding()" + number);
        // 输入框清零，输出框显示结果
        out1.value = number;
    }

    // 向上取整
    function ceilFunction() {
        let number = Math.ceil(eval(in1.value));
        console.log("ceilFunction()" + number);
        // 输入框清零，输出框显示结果
        out1.value = number;
    }

    // 向下取整
    function floorFunction() {
        let number = Math.floor(eval(in1.value));
        console.log("floorFunction()" + number);
        // 输入框清零，输出框显示结果
        out1.value = number;
    }

    // 平方根算法
    function sqrtFunction() {
        let number = Math.sqrt(eval(in1.value));
        console.log("sqrtFunction()" + number);
        // 输入框清零，输出框显示结果
        out1.value = number;
    }

    // 绝对值算法
    function absFunction(){
        let number = Math.abs(eval(in1.value));
        console.log("absFunction()" + number);
        // 输入框清零，输出框显示结果
        out1.value = number;
    }

    // 正弦值算法
    function sinFunction() {
        let number = Math.sin(eval(in1.value));
        console.log("sinFunction()" + number);
        // 输入框清零，输出框显示结果
        out1.value = number;
    }

    // 余弦值算法
    function cosFunction() {
        let number = Math.cos(eval(in1.value));
        console.log("cosFunction()" + number);
        // 输入框清零，输出框显示结果
        out1.value = number;
    }

    function getMinNum() {
        let number =Math.min(in2.value,in3.value);
        console.log("getMinNum()" + number);
        // 输入框清零，输出框显示结果
        out2.value = number;
    }
    function getMaxNum() {
        let number =Math.max(in2.value,in3.value);
        console.log("getMaxNum()" + number);
        // 输入框清零，输出框显示结果
        out2.value = number;
    }

</script>

</body>
</html>
